package friendsearch;

public class Coordinate {
	
	public Coordinate() {
		
	}
	public Coordinate(double x,double y) {
		if(x>180) x=180;
		if(x<-180) x=-180;
		this.longitude=x;
		if(y>90) y=90;
		if(y<-90) y=-90;
		this.latitude=y;		
	}
	
	double longitude;// [-180,180]
	double latitude;// [-90,90]
	public double getLongitude() {
		return longitude;
	}
	public void setLongitude(double longitude) {
		this.longitude = longitude;
	}
	public double getLatitude() {
		return latitude;
	}
	public void setLatitude(double latitude) {
		this.latitude = latitude;
	}
	@Override
	public String toString() {
		return "E"+this.longitude+", N"+this.latitude;
	}
	
	
}
